﻿@model IEnumerable<HRWEB.Post>
@using HRWEB.HtmlHelpers
@{
    ViewBag.Title = "岗位管理";
}
@using (Html.BeginForm("ListPost","Admin"))
{
 <font>输入科室拼音首字母</font> @Html.TextBox("dinput", null, new { style = "width:80px", onChange = "this.form.submit();" })@Html.DropDownList("code", DropDownListHelper.DeptListItem((string)ViewBag.InputDeptCode, (string)ViewBag.SelectedDeptCode)) <input type="submit" value="查询" />
}
@{Html.RenderAction("AddPost");}
<script type="text/javascript">
    jQuery(document).ready(function () {
        $('#postlist').dataTable({ "bPaginate": false,
            "bFilter": false,
            "bSort": true,
            "bInfo": false,
            "bAutoWidth": false,
            "bStateSave": true,
            "fnDrawCallback": function (oSettings) {
                $("#postlist tr").each(function (i) {
                    $(this).hover(function () {
                        $(this).addClass('color3');
                    }, function () {
                        $(this).removeClass('color3');
                    });
                    if ($(this).hasClass('color1')) {
                        $(this).removeClass('color1');
                    }
                    if ($(this).hasClass('color2')) {
                        $(this).removeClass('color2');
                    }
                    if (i % 2) { $(this).addClass('color1'); }
                    else { $(this).addClass('color2'); }
                });
            }
        });
    });
</script>
<table id="postlist">
<thead>@Html.GetTableRow(new string[]{"科室","岗位类型","岗位级别","岗位说明","删除"})</thead>
<tbody>
@foreach (var p in Model)
{
    <tr><td>@Html.FormatTDict(p.TDictDept)</td><td>@Html.FormatTDict(p.TDictJobType)</td><td>@Html.FormatTDict(p.TDictJobLevel)</td><td style="width:600px;word-break:break-all">@Html.Raw( p.JobDescription)</td><td>@Html.ActionLink("删除", "deletePost", new { serialNO = p.SerialNO, dinput = (string)ViewBag.InputDeptCode, code = (string)ViewBag.SelectedDeptCode })</td></tr>
}
</tbody>
</table>